package cubelabs.nexus.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import cubelabs.nexus.entity.CounsellingEvent;
import cubelabs.nexus.entity.User;

@Repository("counsellingEventDAO")
public class CounsellingEventDAO extends BaseDAO<CounsellingEvent, Long>{

	
	
	public List<CounsellingEvent> findAllEventsByUserId(User user) {
		Query query = getSession().createQuery("select sce.counsellingEvent from ScheduledCounsellingEvent sce where sce.user =:user").setLong("user", user.getId());
		return query.list();
	}
	
}
